package com.example.monit.controller;

import com.example.monit.bean.ResponseRust;
import com.example.monit.bean.RoutingSkipBehavior;
import com.example.monit.service.RoutingSkipBehaviorService;
import com.example.monit.vo.RoutingSkipBehaviorVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("/behaviors")
public class RoutingSkipBehaviorController {

    @Autowired
    RoutingSkipBehaviorService routingSkipBehaviorService;


    /**
     * 路由跳转行为数据上传
     */
    @PostMapping("/routingskipbehaviors")
    public ResponseRust routingSkipBehavior(@RequestBody List<RoutingSkipBehavior> routingSkipBehavior) throws IOException {
        return this.routingSkipBehaviorService.upLoadRoutingSkipBehavior(routingSkipBehavior);
    }

    /**
     * 路由跳转行为数据查询
     */
    @GetMapping("/routingskipbehaviors")
    public ResponseRust getRoutingSkipBehavior(RoutingSkipBehaviorVo routingSkipBehaviorVo) throws IOException {
        return this.routingSkipBehaviorService.queryRoutingSkipBehavior(routingSkipBehaviorVo);
    }

}
